/AWS1/IF_RGR=>SEARCHRESOURCES()¶
About SearchResources¶
Returns a list of Amazon Web Services resource identifiers that matches the specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.
Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:SearchResources -
cloudformation:DescribeStacks -
cloudformation:ListStackResources -
tag:GetResources
Method Signature¶
METHODS /AWS1/IF_RGR~SEARCHRESOURCES
IMPORTING
!IO_RESOURCEQUERY TYPE REF TO /AWS1/CL_RGRRESOURCEQUERY OPTIONAL
!IV_MAXRESULTS TYPE /AWS1/RGRMAXRESULTS OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/RGRNEXTTOKEN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_rgrsrchresrcsoutput
RAISING
/AWS1/CX_RGRBADREQUESTEX
/AWS1/CX_RGRFORBIDDENEXCEPTION
/AWS1/CX_RGRINTERNALSERVERER00
/AWS1/CX_RGRMETHODNOTALLOWEDEX
/AWS1/CX_RGRTOOMANYREQUESTSEX
/AWS1/CX_RGRUNAUTHORIZEDEX
/AWS1/CX_RGRCLIENTEXC
/AWS1/CX_RGRSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
io_resourcequery TYPE REF TO /AWS1/CL_RGRRESOURCEQUERY /AWS1/CL_RGRRESOURCEQUERY¶
The search query, using the same formats that are supported for resource group definition. For more information, see CreateGroup.
Optional arguments:¶
iv_maxresults TYPE /AWS1/RGRMAXRESULTS /AWS1/RGRMAXRESULTS¶
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 maximum you specify, the
NextTokenresponse element is present and has a value (is not null). Include that value as theNextTokenrequest 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 checkNextTokenafter every operation to ensure that you receive all of the results.
iv_nexttoken TYPE /AWS1/RGRNEXTTOKEN /AWS1/RGRNEXTTOKEN¶
The parameter for receiving additional results if you receive a
NextTokenresponse in a previous request. ANextTokenresponse indicates that more output is available. Set this parameter to the value provided by a previous call'sNextTokenresponse to indicate where the output should continue from.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_rgrsrchresrcsoutput /AWS1/CL_RGRSRCHRESRCSOUTPUT¶
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->searchresources(
io_resourcequery = new /aws1/cl_rgrresourcequery(
iv_query = |string|
iv_type = |string|
)
iv_maxresults = 123
iv_nexttoken = |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_resourceidentifiers( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_resourcearn = lo_row_1->get_resourcearn( ).
lv_resourcetype = lo_row_1->get_resourcetype( ).
ENDIF.
ENDLOOP.
lv_nexttoken = lo_result->get_nexttoken( ).
LOOP AT lo_result->get_queryerrors( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_queryerrorcode = lo_row_3->get_errorcode( ).
lv_queryerrormessage = lo_row_3->get_message( ).
ENDIF.
ENDLOOP.
ENDIF.