Skip to content

/AWS1/IF_EL2=>DEREGISTERTARGETS()

About DeregisterTargets

Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

The load balancer stops sending requests to targets that are deregistering, but uses connection draining to ensure that in-flight traffic completes on the existing connections. This deregistration delay is configured by default but can be updated for each target group.

For more information, see the following:

Note: If the specified target does not exist, the action returns successfully.

Method Signature

METHODS /AWS1/IF_EL2~DEREGISTERTARGETS
  IMPORTING
    !IV_TARGETGROUPARN TYPE /AWS1/EL2TARGETGROUPARN OPTIONAL
    !IT_TARGETS TYPE /AWS1/CL_EL2TARGETDESCRIPTION=>TT_TARGETDESCRIPTIONS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_el2deregtargetsoutput
  RAISING
    /AWS1/CX_EL2INVALIDTARGETEX
    /AWS1/CX_EL2TGTGROUPNOTFOUNDEX
    /AWS1/CX_EL2CLIENTEXC
    /AWS1/CX_EL2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_targetgrouparn TYPE /AWS1/EL2TARGETGROUPARN /AWS1/EL2TARGETGROUPARN

The Amazon Resource Name (ARN) of the target group.

it_targets TYPE /AWS1/CL_EL2TARGETDESCRIPTION=>TT_TARGETDESCRIPTIONS TT_TARGETDESCRIPTIONS

The targets. If you specified a port override when you registered a target, you must specify both the target ID and the port when you deregister it.

RETURNING

oo_output TYPE REF TO /aws1/cl_el2deregtargetsoutput /AWS1/CL_EL2DEREGTARGETSOUTPUT

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->deregistertargets(
  it_targets = VALUE /aws1/cl_el2targetdescription=>tt_targetdescriptions(
    (
      new /aws1/cl_el2targetdescription(
        iv_availabilityzone = |string|
        iv_id = |string|
        iv_port = 123
        iv_quicserverid = |string|
      )
    )
  )
  iv_targetgrouparn = |string|
).

This is an example of reading all possible response values

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

To deregister a target from a target group

This example deregisters the specified instance from the specified target group.

DATA(lo_result) = lo_client->deregistertargets(
  it_targets = VALUE /aws1/cl_el2targetdescription=>tt_targetdescriptions(
    ( new /aws1/cl_el2targetdescription( iv_id = |i-0f76fade| )  )
  )
  iv_targetgrouparn = |arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067|
).