/AWS1/IF_CWL=>DESCRIBEACCOUNTPOLICIES()¶
About DescribeAccountPolicies¶
Returns a list of all CloudWatch Logs account policies in the account.
To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are retrieving information for.
-
To see data protection policies, you must have the
logs:GetDataProtectionPolicyandlogs:DescribeAccountPoliciespermissions. -
To see subscription filter policies, you must have the
logs:DescribeSubscriptionFiltersandlogs:DescribeAccountPoliciespermissions. -
To see transformer policies, you must have the
logs:GetTransformerandlogs:DescribeAccountPoliciespermissions. -
To see field index policies, you must have the
logs:DescribeIndexPoliciesandlogs:DescribeAccountPoliciespermissions.
Method Signature¶
METHODS /AWS1/IF_CWL~DESCRIBEACCOUNTPOLICIES
IMPORTING
!IV_POLICYTYPE TYPE /AWS1/CWLPOLICYTYPE OPTIONAL
!IV_POLICYNAME TYPE /AWS1/CWLPOLICYNAME OPTIONAL
!IT_ACCOUNTIDENTIFIERS TYPE /AWS1/CL_CWLACCOUNTIDS_W=>TT_ACCOUNTIDS OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/CWLNEXTTOKEN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwldescraccountpolrsp
RAISING
/AWS1/CX_CWLINVALIDPARAMETEREX
/AWS1/CX_CWLOPERATIONABORTEDEX
/AWS1/CX_CWLRESOURCENOTFOUNDEX
/AWS1/CX_CWLSERVICEUNAVAILEX
/AWS1/CX_CWLCLIENTEXC
/AWS1/CX_CWLSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_policytype TYPE /AWS1/CWLPOLICYTYPE /AWS1/CWLPOLICYTYPE¶
Use this parameter to limit the returned policies to only the policies that match the policy type that you specify.
Optional arguments:¶
iv_policyname TYPE /AWS1/CWLPOLICYNAME /AWS1/CWLPOLICYNAME¶
Use this parameter to limit the returned policies to only the policy with the name that you specify.
it_accountidentifiers TYPE /AWS1/CL_CWLACCOUNTIDS_W=>TT_ACCOUNTIDS TT_ACCOUNTIDS¶
If you are using an account that is set up as a monitoring account for CloudWatch unified cross-account observability, you can use this to specify the account ID of a source account. If you do, the operation returns the account policy for the specified account. Currently, you can specify only one account ID in this parameter.
If you omit this parameter, only the policy in the current account is returned.
iv_nexttoken TYPE /AWS1/CWLNEXTTOKEN /AWS1/CWLNEXTTOKEN¶
The token for the next set of items to return. (You received this token from a previous call.)
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cwldescraccountpolrsp /AWS1/CL_CWLDESCRACCOUNTPOLRSP¶
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->describeaccountpolicies(
it_accountidentifiers = VALUE /aws1/cl_cwlaccountids_w=>tt_accountids(
( new /aws1/cl_cwlaccountids_w( |string| ) )
)
iv_nexttoken = |string|
iv_policyname = |string|
iv_policytype = |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_accountpolicies( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_policyname = lo_row_1->get_policyname( ).
lv_accountpolicydocument = lo_row_1->get_policydocument( ).
lv_timestamp = lo_row_1->get_lastupdatedtime( ).
lv_policytype = lo_row_1->get_policytype( ).
lv_scope = lo_row_1->get_scope( ).
lv_selectioncriteria = lo_row_1->get_selectioncriteria( ).
lv_accountid = lo_row_1->get_accountid( ).
ENDIF.
ENDLOOP.
lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.