Skip to content

/AWS1/CL_IAM=>LISTSERVICESPECIFICCREDS()

About ListServiceSpecificCredentials

Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. For more information about using service-specific credentials to authenticate to an Amazon Web Services service, see Set up service-specific credentials in the CodeCommit User Guide.

Method Signature

IMPORTING

Optional arguments:

iv_username TYPE /AWS1/IAMUSERNAMETYPE /AWS1/IAMUSERNAMETYPE

The name of the user whose service-specific credentials you want information about. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

iv_servicename TYPE /AWS1/IAMSERVICENAME /AWS1/IAMSERVICENAME

Filters the returned results to only those for the specified Amazon Web Services service. If not specified, then Amazon Web Services returns service-specific credentials for all services.

RETURNING

oo_output TYPE REF TO /aws1/cl_iamlistsvcspfcredsrsp /AWS1/CL_IAMLISTSVCSPFCREDSRSP

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_iam~listservicespecificcreds(
  iv_servicename = |string|
  iv_username = |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_servicespecificcreds( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_usernametype = lo_row_1->get_username( ).
      lv_statustype = lo_row_1->get_status( ).
      lv_serviceusername = lo_row_1->get_serviceusername( ).
      lv_datetype = lo_row_1->get_createdate( ).
      lv_servicespecificcredenti = lo_row_1->get_servicespecificcredid( ).
      lv_servicename = lo_row_1->get_servicename( ).
    ENDIF.
  ENDLOOP.
ENDIF.