Skip to content

/AWS1/CL_SSS=>GETCOMPONENT()

About GetComponent

Gets the component of an application registered with AWS Systems Manager for SAP.

Method Signature

IMPORTING

Required arguments:

iv_applicationid TYPE /AWS1/SSSAPPLICATIONID /AWS1/SSSAPPLICATIONID

The ID of the application.

iv_componentid TYPE /AWS1/SSSCOMPONENTID /AWS1/SSSCOMPONENTID

The ID of the component.

RETURNING

oo_output TYPE REF TO /aws1/cl_sssgetcomponentoutput /AWS1/CL_SSSGETCOMPONENTOUTPUT

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_sss~getcomponent(
  iv_applicationid = |string|
  iv_componentid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_component = lo_result->get_component( ).
  IF lo_component IS NOT INITIAL.
    lv_componentid = lo_component->get_componentid( ).
    lv_sid = lo_component->get_sid( ).
    lv_sapinstancenumber = lo_component->get_systemnumber( ).
    lv_componentid = lo_component->get_parentcomponent( ).
    LOOP AT lo_component->get_childcomponents( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_componentid = lo_row_1->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_applicationid = lo_component->get_applicationid( ).
    lv_componenttype = lo_component->get_componenttype( ).
    lv_componentstatus = lo_component->get_status( ).
    lv_string = lo_component->get_saphostname( ).
    lv_string = lo_component->get_sapfeature( ).
    lv_string = lo_component->get_sapkernelversion( ).
    lv_string = lo_component->get_hdbversion( ).
    lo_resilience = lo_component->get_resilience( ).
    IF lo_resilience IS NOT INITIAL.
      lv_string = lo_resilience->get_hsrtier( ).
      lv_replicationmode = lo_resilience->get_hsrreplicationmode( ).
      lv_operationmode = lo_resilience->get_hsroperationmode( ).
      lv_clusterstatus = lo_resilience->get_clusterstatus( ).
      lv_boolean = lo_resilience->get_enqueuereplication( ).
    ENDIF.
    lo_associatedhost = lo_component->get_associatedhost( ).
    IF lo_associatedhost IS NOT INITIAL.
      lv_string = lo_associatedhost->get_hostname( ).
      lv_string = lo_associatedhost->get_ec2instanceid( ).
      LOOP AT lo_associatedhost->get_ipaddresses( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_string = lo_row_3->get_ipaddress( ).
          lv_boolean = lo_row_3->get_primary( ).
          lv_allocationtype = lo_row_3->get_allocationtype( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_associatedhost->get_osversion( ).
    ENDIF.
    LOOP AT lo_component->get_databases( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_databaseid = lo_row_5->get_value( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_component->get_hosts( ) into lo_row_6.
      lo_row_7 = lo_row_6.
      IF lo_row_7 IS NOT INITIAL.
        lv_string = lo_row_7->get_hostname( ).
        lv_string = lo_row_7->get_hostip( ).
        lv_string = lo_row_7->get_ec2instanceid( ).
        lv_string = lo_row_7->get_instanceid( ).
        lv_hostrole = lo_row_7->get_hostrole( ).
        lv_string = lo_row_7->get_osversion( ).
      ENDIF.
    ENDLOOP.
    lv_string = lo_component->get_primaryhost( ).
    lo_databaseconnection = lo_component->get_databaseconnection( ).
    IF lo_databaseconnection IS NOT INITIAL.
      lv_databaseconnectionmetho = lo_databaseconnection->get_databaseconnectionmethod( ).
      lv_ssmsaparn = lo_databaseconnection->get_databasearn( ).
      lv_string = lo_databaseconnection->get_connectionip( ).
    ENDIF.
    lv_timestamp = lo_component->get_lastupdated( ).
    lv_ssmsaparn = lo_component->get_arn( ).
  ENDIF.
  LOOP AT lo_result->get_tags( ) into ls_row_8.
    lv_key = ls_row_8-key.
    lo_value = ls_row_8-value.
    IF lo_value IS NOT INITIAL.
      lv_tagvalue = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.