/AWS1/IF_WAD=>CREATEAGENTCONTEXT()¶
About CreateAgentContext¶
Creates a context associated with an optimization profile. Contexts provide application and environment information used during recommendation generation.
Method Signature¶
METHODS /AWS1/IF_WAD~CREATEAGENTCONTEXT
IMPORTING
!IV_CLIENTTOKEN TYPE /AWS1/WADSTRING OPTIONAL
!IV_PROFILEARN TYPE /AWS1/WADAGENTPROFILEARN OPTIONAL
!IV_TITLE TYPE /AWS1/WADSENSITIVESTRING OPTIONAL
!IV_CONTEXTTYPE TYPE /AWS1/WADCONTEXTTYPE OPTIONAL
!IO_CONTENT TYPE REF TO /AWS1/CL_WADCONTEXTCONTENT OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_wadcreateagentctxrsp
RAISING
/AWS1/CX_WADACCESSDENIEDEX
/AWS1/CX_WADCONFLICTEXCEPTION
/AWS1/CX_WADINTERNALSERVEREX
/AWS1/CX_WADRESOURCENOTFOUNDEX
/AWS1/CX_WADSERVICEQUOTAEXCDEX
/AWS1/CX_WADTHROTTLINGEX
/AWS1/CX_WADVALIDATIONEX
/AWS1/CX_WADCLIENTEXC
/AWS1/CX_WADSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_profilearn TYPE /AWS1/WADAGENTPROFILEARN /AWS1/WADAGENTPROFILEARN¶
The Amazon Resource Name (ARN) of the profile to associate the context with.
iv_title TYPE /AWS1/WADSENSITIVESTRING /AWS1/WADSENSITIVESTRING¶
The title of the context.
iv_contexttype TYPE /AWS1/WADCONTEXTTYPE /AWS1/WADCONTEXTTYPE¶
The type of the context.
io_content TYPE REF TO /AWS1/CL_WADCONTEXTCONTENT /AWS1/CL_WADCONTEXTCONTENT¶
The typed content of the context. The structure contains application-specific fields such as account IDs, Regions, services, and resource types.
Optional arguments:¶
iv_clienttoken TYPE /AWS1/WADSTRING /AWS1/WADSTRING¶
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_wadcreateagentctxrsp /AWS1/CL_WADCREATEAGENTCTXRSP¶
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->createagentcontext(
io_content = new /aws1/cl_wadcontextcontent(
it_accountids = VALUE /aws1/cl_wadctxacctidlist_w=>tt_contextaccountidlist(
( new /aws1/cl_wadctxacctidlist_w( |string| ) )
)
it_awsservices = VALUE /aws1/cl_wadctxawssvclist_w=>tt_contextawsservicelist(
( new /aws1/cl_wadctxawssvclist_w( |string| ) )
)
it_regions = VALUE /aws1/cl_wadctxregionlist_w=>tt_contextregionlist(
( new /aws1/cl_wadctxregionlist_w( |string| ) )
)
it_resourcetags = VALUE /aws1/cl_wadcontextresourcetag=>tt_contextresourcetaglist(
(
new /aws1/cl_wadcontextresourcetag(
iv_key = |string|
iv_value = |string|
)
)
)
it_resourcetypes = VALUE /aws1/cl_wadctxrestypelist_w=>tt_contextresourcetypelist(
( new /aws1/cl_wadctxrestypelist_w( |string| ) )
)
iv_additionalcontext = |string|
iv_applicationoverview = |string|
iv_applicationtype = |string|
iv_architectureoverview = |string|
iv_criticality = |string|
iv_industry = |string|
)
iv_clienttoken = |string|
iv_contexttype = |string|
iv_profilearn = |string|
iv_title = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_contextsummary = lo_result->get_context( ).
IF lo_contextsummary IS NOT INITIAL.
lv_uuid = lo_contextsummary->get_id( ).
lv_agentprofilearn = lo_contextsummary->get_profilearn( ).
lv_sensitivestring = lo_contextsummary->get_title( ).
lv_contexttype = lo_contextsummary->get_contexttype( ).
lo_contextcontent = lo_contextsummary->get_content( ).
IF lo_contextcontent IS NOT INITIAL.
LOOP AT lo_contextcontent->get_accountids( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_contextcontent->get_regions( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_contextcontent->get_awsservices( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_string = lo_row_5->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_contextcontent->get_resourcetypes( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_string = lo_row_7->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_contextcontent->get_resourcetags( ) into lo_row_8.
lo_row_9 = lo_row_8.
IF lo_row_9 IS NOT INITIAL.
lv_string = lo_row_9->get_key( ).
lv_string = lo_row_9->get_value( ).
ENDIF.
ENDLOOP.
lv_sensitivestring = lo_contextcontent->get_applicationoverview( ).
lv_sensitivestring = lo_contextcontent->get_industry( ).
lv_applicationtype = lo_contextcontent->get_applicationtype( ).
lv_criticality = lo_contextcontent->get_criticality( ).
lv_sensitivestring = lo_contextcontent->get_architectureoverview( ).
lv_sensitivestring = lo_contextcontent->get_additionalcontext( ).
ENDIF.
lv_applicationtype = lo_contextsummary->get_applicationtype( ).
lv_criticality = lo_contextsummary->get_criticality( ).
lv_string = lo_contextsummary->get_createdby( ).
lv_timestamp = lo_contextsummary->get_createdat( ).
lv_string = lo_contextsummary->get_lastmodifiedby( ).
lv_timestamp = lo_contextsummary->get_lastmodifiedat( ).
ENDIF.
ENDIF.