Skip to content

/AWS1/CL_ELB=>ADDTAGS()

About AddTags

Adds the specified tags to the specified load balancer. Each load balancer can have a maximum of 10 tags.

Each tag consists of a key and an optional value. If a tag with the same key is already associated with the load balancer, AddTags updates its value.

For more information, see Tag Your Classic Load Balancer in the Classic Load Balancers Guide.

Method Signature

IMPORTING

Required arguments:

it_loadbalancernames TYPE /AWS1/CL_ELBLOADBALANCERNAME00=>TT_LOADBALANCERNAMES TT_LOADBALANCERNAMES

The name of the load balancer. You can specify one load balancer only.

it_tags TYPE /AWS1/CL_ELBTAG=>TT_TAGLIST TT_TAGLIST

The tags.

RETURNING

oo_output TYPE REF TO /aws1/cl_elbaddtagsoutput /AWS1/CL_ELBADDTAGSOUTPUT

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_elb~addtags(
  it_loadbalancernames = VALUE /aws1/cl_elbloadbalancername00=>tt_loadbalancernames(
    ( new /aws1/cl_elbloadbalancername00( |string| ) )
  )
  it_tags = VALUE /aws1/cl_elbtag=>tt_taglist(
    (
      new /aws1/cl_elbtag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
ENDIF.

To add tags to a load balancer

This example adds two tags to the specified load balancer.

DATA(lo_result) = lo_client->/aws1/if_elb~addtags(
  it_loadbalancernames = VALUE /aws1/cl_elbloadbalancername00=>tt_loadbalancernames(
    ( new /aws1/cl_elbloadbalancername00( |my-load-balancer| ) )
  )
  it_tags = VALUE /aws1/cl_elbtag=>tt_taglist(
    (
      new /aws1/cl_elbtag(
        iv_key = |project|
        iv_value = |lima|
      )
    )
    (
      new /aws1/cl_elbtag(
        iv_key = |department|
        iv_value = |digital-media|
      )
    )
  )
).