/AWS1/IF_CWS=>GETSERVICE()¶
About GetService¶
Returns information about a service discovered by Application Signals.
Method Signature¶
METHODS /AWS1/IF_CWS~GETSERVICE
IMPORTING
!IV_STARTTIME TYPE /AWS1/CWSTIMESTAMP OPTIONAL
!IV_ENDTIME TYPE /AWS1/CWSTIMESTAMP OPTIONAL
!IT_KEYATTRIBUTES TYPE /AWS1/CL_CWSATTRIBUTES_W=>TT_ATTRIBUTES OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwsgetserviceoutput
RAISING
/AWS1/CX_CWSTHROTTLINGEX
/AWS1/CX_CWSVALIDATIONEX
/AWS1/CX_CWSCLIENTEXC
/AWS1/CX_CWSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_starttime TYPE /AWS1/CWSTIMESTAMP /AWS1/CWSTIMESTAMP¶
The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example:
1698778057Your requested start time will be rounded to the nearest hour.
iv_endtime TYPE /AWS1/CWSTIMESTAMP /AWS1/CWSTIMESTAMP¶
The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example:
1698778057Your requested start time will be rounded to the nearest hour.
it_keyattributes TYPE /AWS1/CL_CWSATTRIBUTES_W=>TT_ATTRIBUTES TT_ATTRIBUTES¶
Use this field to specify which service you want to retrieve information for. You must specify at least the
Type,Name, andEnvironmentattributes.This is a string-to-string map. It can include the following fields.
Typedesignates the type of object this is.
ResourceTypespecifies the type of the resource. This field is used only when the value of theTypefield isResourceorAWS::Resource.
Namespecifies the name of the object. This is used only if the value of theTypefield isService,RemoteService, orAWS::Service.
Identifieridentifies the resource objects of this resource. This is used only if the value of theTypefield isResourceorAWS::Resource.
Environmentspecifies the location where this object is hosted, or what it belongs to.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cwsgetserviceoutput /AWS1/CL_CWSGETSERVICEOUTPUT¶
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->getservice(
it_keyattributes = VALUE /aws1/cl_cwsattributes_w=>tt_attributes(
(
VALUE /aws1/cl_cwsattributes_w=>ts_attributes_maprow(
value = new /aws1/cl_cwsattributes_w( |string| )
key = |string|
)
)
)
iv_endtime = '20150101000000.0000000'
iv_starttime = '20150101000000.0000000'
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_service = lo_result->get_service( ).
IF lo_service IS NOT INITIAL.
LOOP AT lo_service->get_keyattributes( ) into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_keyattributevalue = lo_value->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_service->get_attributemaps( ) into lt_row_1.
LOOP AT lt_row_1 into ls_row_2.
lv_key_1 = ls_row_2-key.
lo_value_1 = ls_row_2-value.
IF lo_value_1 IS NOT INITIAL.
lv_string = lo_value_1->get_value( ).
ENDIF.
ENDLOOP.
ENDLOOP.
LOOP AT lo_service->get_servicegroups( ) into lo_row_3.
lo_row_4 = lo_row_3.
IF lo_row_4 IS NOT INITIAL.
lv_groupname = lo_row_4->get_groupname( ).
lv_groupvalue = lo_row_4->get_groupvalue( ).
lv_groupsource = lo_row_4->get_groupsource( ).
lv_groupidentifier = lo_row_4->get_groupidentifier( ).
ENDIF.
ENDLOOP.
LOOP AT lo_service->get_metricreferences( ) into lo_row_5.
lo_row_6 = lo_row_5.
IF lo_row_6 IS NOT INITIAL.
lv_namespace = lo_row_6->get_namespace( ).
lv_metrictype = lo_row_6->get_metrictype( ).
LOOP AT lo_row_6->get_dimensions( ) into lo_row_7.
lo_row_8 = lo_row_7.
IF lo_row_8 IS NOT INITIAL.
lv_dimensionname = lo_row_8->get_name( ).
lv_dimensionvalue = lo_row_8->get_value( ).
ENDIF.
ENDLOOP.
lv_metricname = lo_row_6->get_metricname( ).
lv_awsaccountid = lo_row_6->get_accountid( ).
ENDIF.
ENDLOOP.
LOOP AT lo_service->get_loggroupreferences( ) into lt_row_9.
LOOP AT lt_row_9 into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_keyattributevalue = lo_value->get_value( ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
lv_timestamp = lo_result->get_starttime( ).
lv_timestamp = lo_result->get_endtime( ).
LOOP AT lo_result->get_loggroupreferences( ) into lt_row_9.
LOOP AT lt_row_9 into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_keyattributevalue = lo_value->get_value( ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.