/AWS1/IF_AAN=>GETGENERATEDPOLICY()¶
About GetGeneratedPolicy¶
Retrieves the policy that was generated using StartPolicyGeneration.
Method Signature¶
METHODS /AWS1/IF_AAN~GETGENERATEDPOLICY
IMPORTING
!IV_JOBID TYPE /AWS1/AANJOBID OPTIONAL
!IV_INCLRESOURCEPLACEHOLDERS TYPE /AWS1/AANBOOLEAN OPTIONAL
!IV_INCLUDESERVICELEVELTMPL TYPE /AWS1/AANBOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_aangetgeneratedplyrsp
RAISING
/AWS1/CX_AANACCESSDENIEDEX
/AWS1/CX_AANINTERNALSERVEREX
/AWS1/CX_AANTHROTTLINGEX
/AWS1/CX_AANVALIDATIONEX
/AWS1/CX_AANCLIENTEXC
/AWS1/CX_AANSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_jobid TYPE /AWS1/AANJOBID /AWS1/AANJOBID¶
The
JobIdthat is returned by theStartPolicyGenerationoperation. TheJobIdcan be used withGetGeneratedPolicyto retrieve the generated policies or used withCancelPolicyGenerationto cancel the policy generation request.
Optional arguments:¶
iv_inclresourceplaceholders TYPE /AWS1/AANBOOLEAN /AWS1/AANBOOLEAN¶
The level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies.
For example, in the resource section of a policy, you can receive a placeholder such as
"Resource":"arn:aws:s3:::${BucketName}"instead of"*".
iv_includeserviceleveltmpl TYPE /AWS1/AANBOOLEAN /AWS1/AANBOOLEAN¶
The level of detail that you want to generate. You can specify whether to generate service-level policies.
IAM Access Analyzer uses
iam:servicelastaccessedto identify services that have been used recently to create this service-level template.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_aangetgeneratedplyrsp /AWS1/CL_AANGETGENERATEDPLYRSP¶
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->getgeneratedpolicy(
iv_inclresourceplaceholders = ABAP_TRUE
iv_includeserviceleveltmpl = ABAP_TRUE
iv_jobid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_jobdetails = lo_result->get_jobdetails( ).
IF lo_jobdetails IS NOT INITIAL.
lv_jobid = lo_jobdetails->get_jobid( ).
lv_jobstatus = lo_jobdetails->get_status( ).
lv_timestamp = lo_jobdetails->get_startedon( ).
lv_timestamp = lo_jobdetails->get_completedon( ).
lo_joberror = lo_jobdetails->get_joberror( ).
IF lo_joberror IS NOT INITIAL.
lv_joberrorcode = lo_joberror->get_code( ).
lv_string = lo_joberror->get_message( ).
ENDIF.
ENDIF.
lo_generatedpolicyresult = lo_result->get_generatedpolicyresult( ).
IF lo_generatedpolicyresult IS NOT INITIAL.
lo_generatedpolicyproperti = lo_generatedpolicyresult->get_properties( ).
IF lo_generatedpolicyproperti IS NOT INITIAL.
lv_boolean = lo_generatedpolicyproperti->get_iscomplete( ).
lv_principalarn = lo_generatedpolicyproperti->get_principalarn( ).
lo_cloudtrailproperties = lo_generatedpolicyproperti->get_cloudtrailproperties( ).
IF lo_cloudtrailproperties IS NOT INITIAL.
LOOP AT lo_cloudtrailproperties->get_trailproperties( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_cloudtrailarn = lo_row_1->get_cloudtrailarn( ).
LOOP AT lo_row_1->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.
lv_boolean = lo_row_1->get_allregions( ).
ENDIF.
ENDLOOP.
lv_timestamp = lo_cloudtrailproperties->get_starttime( ).
lv_timestamp = lo_cloudtrailproperties->get_endtime( ).
ENDIF.
ENDIF.
LOOP AT lo_generatedpolicyresult->get_generatedpolicies( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_string = lo_row_5->get_policy( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.