Skip to content

/AWS1/IF_CGP=>LISTUSERPOOLREPLICAS()

About ListUserPoolReplicas

Lists all replicas for a user pool, including both primary and secondary replicas. We recommend using pagination to ensure that the operation returns quickly and successfully.

Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Method Signature

METHODS /AWS1/IF_CGP~LISTUSERPOOLREPLICAS
  IMPORTING
    !IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/CGPPAGINATIONKEYTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgplistuserplrplsrsp
  RAISING
    /AWS1/CX_CGPINTERNALERROREX
    /AWS1/CX_CGPINVALIDPARAMETEREX
    /AWS1/CX_CGPNOTAUTHORIZEDEX
    /AWS1/CX_CGPOPNOTENABLEDEX
    /AWS1/CX_CGPRESOURCENOTFOUNDEX
    /AWS1/CX_CGPTOOMANYREQUESTSEX
    /AWS1/CX_CGPCLIENTEXC
    /AWS1/CX_CGPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE

The ID of the user pool for which to list replicas.

Optional arguments:

iv_nexttoken TYPE /AWS1/CGPPAGINATIONKEYTYPE /AWS1/CGPPAGINATIONKEYTYPE

A pagination token for retrieving the next page of results. If this parameter is omitted, the operation returns the first page of results.

RETURNING

oo_output TYPE REF TO /aws1/cl_cgplistuserplrplsrsp /AWS1/CL_CGPLISTUSERPLRPLSRSP

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->listuserpoolreplicas(
  iv_nexttoken = |string|
  iv_userpoolid = |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_userpoolreplicas( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_regionnametype = lo_row_1->get_regionname( ).
      lv_replicastatustype = lo_row_1->get_status( ).
      lv_replicaroletype = lo_row_1->get_role( ).
      lv_arntype = lo_row_1->get_userpoolarn( ).
    ENDIF.
  ENDLOOP.
  lv_paginationkeytype = lo_result->get_nexttoken( ).
ENDIF.

Example list the replicas of a user pool

The following example lists the replicas of a user pool that has a replica in the ap-south-1 Region.

DATA(lo_result) = lo_client->listuserpoolreplicas( iv_userpoolid = |eu-north-1_abcd12345| ) .