/AWS1/IF_SSM=>GETINVENTORY()¶
About GetInventory¶
Query inventory information. This includes managed node status, such as Stopped
or Terminated.
Method Signature¶
METHODS /AWS1/IF_SSM~GETINVENTORY
IMPORTING
!IT_FILTERS TYPE /AWS1/CL_SSMINVENTORYFILTER=>TT_INVENTORYFILTERLIST OPTIONAL
!IT_AGGREGATORS TYPE /AWS1/CL_SSMINVAGGREGATOR=>TT_INVENTORYAGGREGATORLIST OPTIONAL
!IT_RESULTATTRIBUTES TYPE /AWS1/CL_SSMRESULTATTRIBUTE=>TT_RESULTATTRIBUTELIST OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/SSMNEXTTOKEN OPTIONAL
!IV_MAXRESULTS TYPE /AWS1/SSMMAXRESULTS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ssmgetinventoryresult
RAISING
/AWS1/CX_SSMINTERNALSERVERERR
/AWS1/CX_SSMINVAGGREGATOREX
/AWS1/CX_SSMINVALIDFILTER
/AWS1/CX_SSMINVALIDINVGROUPEX
/AWS1/CX_SSMINVALIDNEXTTOKEN
/AWS1/CX_SSMINVRESULTATTREX
/AWS1/CX_SSMINVALIDTYPENAMEEX
/AWS1/CX_SSMCLIENTEXC
/AWS1/CX_SSMSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Optional arguments:¶
it_filters TYPE /AWS1/CL_SSMINVENTORYFILTER=>TT_INVENTORYFILTERLIST TT_INVENTORYFILTERLIST¶
One or more filters. Use a filter to return a more specific list of results.
it_aggregators TYPE /AWS1/CL_SSMINVAGGREGATOR=>TT_INVENTORYAGGREGATORLIST TT_INVENTORYAGGREGATORLIST¶
Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the
AWS:InstanceInformation.PlatformTypetype, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.
it_resultattributes TYPE /AWS1/CL_SSMRESULTATTRIBUTE=>TT_RESULTATTRIBUTELIST TT_RESULTATTRIBUTELIST¶
The list of inventory item types to return.
iv_nexttoken TYPE /AWS1/SSMNEXTTOKEN /AWS1/SSMNEXTTOKEN¶
The token for the next set of items to return. (You received this token from a previous call.)
iv_maxresults TYPE /AWS1/SSMMAXRESULTS /AWS1/SSMMAXRESULTS¶
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ssmgetinventoryresult /AWS1/CL_SSMGETINVENTORYRESULT¶
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->getinventory(
it_aggregators = VALUE /aws1/cl_ssminvaggregator=>tt_inventoryaggregatorlist(
(
new /aws1/cl_ssminvaggregator(
it_aggregators = VALUE /aws1/cl_ssminvaggregator=>tt_inventoryaggregatorlist(
)
it_groups = VALUE /aws1/cl_ssminventorygroup=>tt_inventorygrouplist(
(
new /aws1/cl_ssminventorygroup(
it_filters = VALUE /aws1/cl_ssminventoryfilter=>tt_inventoryfilterlist(
(
new /aws1/cl_ssminventoryfilter(
it_values = VALUE /aws1/cl_ssminvfiltvaluelist_w=>tt_inventoryfiltervaluelist(
( new /aws1/cl_ssminvfiltvaluelist_w( |string| ) )
)
iv_key = |string|
iv_type = |string|
)
)
)
iv_name = |string|
)
)
)
iv_expression = |string|
)
)
)
it_filters = VALUE /aws1/cl_ssminventoryfilter=>tt_inventoryfilterlist(
(
new /aws1/cl_ssminventoryfilter(
it_values = VALUE /aws1/cl_ssminvfiltvaluelist_w=>tt_inventoryfiltervaluelist(
( new /aws1/cl_ssminvfiltvaluelist_w( |string| ) )
)
iv_key = |string|
iv_type = |string|
)
)
)
it_resultattributes = VALUE /aws1/cl_ssmresultattribute=>tt_resultattributelist(
( new /aws1/cl_ssmresultattribute( |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_entities( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_inventoryresultentityid = lo_row_1->get_id( ).
LOOP AT lo_row_1->get_data( ) into ls_row_2.
lv_key = ls_row_2-key.
lo_value = ls_row_2-value.
IF lo_value IS NOT INITIAL.
lv_inventoryitemtypename = lo_value->get_typename( ).
lv_inventoryitemschemavers = lo_value->get_schemaversion( ).
lv_inventoryitemcapturetim = lo_value->get_capturetime( ).
lv_inventoryitemcontenthas = lo_value->get_contenthash( ).
LOOP AT lo_value->get_content( ) into lt_row_3.
LOOP AT lt_row_3 into ls_row_4.
lv_key_1 = ls_row_4-key.
lo_value_1 = ls_row_4-value.
IF lo_value_1 IS NOT INITIAL.
lv_attributevalue = lo_value_1->get_value( ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.