Skip to content

/AWS1/CL_RAM=>GETRESOURCESHARES()

About GetResourceShares

Retrieves details about the resource shares that you own or that are shared with you.

Method Signature

IMPORTING

Required arguments:

iv_resourceowner TYPE /AWS1/RAMRESOURCEOWNER /AWS1/RAMRESOURCEOWNER

Specifies that you want to retrieve details of only those resource shares that match the following:

  • SELF – resource shares that your account shares with other accounts

  • OTHER-ACCOUNTS – resource shares that other accounts share with your account

Optional arguments:

it_resourcesharearns TYPE /AWS1/CL_RAMRESRCSHAREARNLST_W=>TT_RESOURCESHAREARNLIST TT_RESOURCESHAREARNLIST

Specifies the Amazon Resource Names (ARNs) of individual resource shares that you want information about.

iv_resourcesharestatus TYPE /AWS1/RAMRESOURCESHARESTATUS /AWS1/RAMRESOURCESHARESTATUS

Specifies that you want to retrieve details of only those resource shares that have this status.

iv_name TYPE /AWS1/RAMSTRING /AWS1/RAMSTRING

Specifies the name of an individual resource share that you want to retrieve details about.

it_tagfilters TYPE /AWS1/CL_RAMTAGFILTER=>TT_TAGFILTERS TT_TAGFILTERS

Specifies that you want to retrieve details of only those resource shares that match the specified tag keys and values.

iv_nexttoken TYPE /AWS1/RAMSTRING /AWS1/RAMSTRING

Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

iv_maxresults TYPE /AWS1/RAMMAXRESULTS /AWS1/RAMMAXRESULTS

Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

iv_permissionarn TYPE /AWS1/RAMSTRING /AWS1/RAMSTRING

Specifies that you want to retrieve details of only those resource shares that use the managed permission with this Amazon Resource Name (ARN).

iv_permissionversion TYPE /AWS1/RAMINTEGER /AWS1/RAMINTEGER

Specifies that you want to retrieve details for only those resource shares that use the specified version of the managed permission.

RETURNING

oo_output TYPE REF TO /aws1/cl_ramgetresrcsharesrsp /AWS1/CL_RAMGETRESRCSHARESRSP

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_ram~getresourceshares(
  it_resourcesharearns = VALUE /aws1/cl_ramresrcsharearnlst_w=>tt_resourcesharearnlist(
    ( new /aws1/cl_ramresrcsharearnlst_w( |string| ) )
  )
  it_tagfilters = VALUE /aws1/cl_ramtagfilter=>tt_tagfilters(
    (
      new /aws1/cl_ramtagfilter(
        it_tagvalues = VALUE /aws1/cl_ramtagvaluelist_w=>tt_tagvaluelist(
          ( new /aws1/cl_ramtagvaluelist_w( |string| ) )
        )
        iv_tagkey = |string|
      )
    )
  )
  iv_maxresults = 123
  iv_name = |string|
  iv_nexttoken = |string|
  iv_permissionarn = |string|
  iv_permissionversion = 123
  iv_resourceowner = |string|
  iv_resourcesharestatus = |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_resourceshares( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_resourcesharearn( ).
      lv_string = lo_row_1->get_name( ).
      lv_string = lo_row_1->get_owningaccountid( ).
      lv_boolean = lo_row_1->get_allowexternalprincipals( ).
      lv_resourcesharestatus = lo_row_1->get_status( ).
      lv_string = lo_row_1->get_statusmessage( ).
      LOOP AT lo_row_1->get_tags( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_tagkey = lo_row_3->get_key( ).
          lv_tagvalue = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_datetime = lo_row_1->get_creationtime( ).
      lv_datetime = lo_row_1->get_lastupdatedtime( ).
      lv_resourcesharefeatureset = lo_row_1->get_featureset( ).
    ENDIF.
  ENDLOOP.
  lv_string = lo_result->get_nexttoken( ).
ENDIF.