Skip to content

/AWS1/IF_NWS=>GETRULE()

About GetRule

Retrieves the details of the specified rule.

Method Signature

METHODS /AWS1/IF_NWS~GETRULE
  IMPORTING
    !IV_RULEIDENTIFIER TYPE /AWS1/NWSRULEIDENTIFIER OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_nwsgetruleoutput
  RAISING
    /AWS1/CX_NWSACCESSDENIEDEX
    /AWS1/CX_NWSINTERNALSERVEREX
    /AWS1/CX_NWSRESOURCENOTFOUNDEX
    /AWS1/CX_NWSTHROTTLINGEX
    /AWS1/CX_NWSVLDTNEXCEPTION
    /AWS1/CX_NWSCLIENTEXC
    /AWS1/CX_NWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_ruleidentifier TYPE /AWS1/NWSRULEIDENTIFIER /AWS1/NWSRULEIDENTIFIER

The identifier of the rule. This is the rule's Amazon Resource Name (ARN).

RETURNING

oo_output TYPE REF TO /aws1/cl_nwsgetruleoutput /AWS1/CL_NWSGETRULEOUTPUT

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->getrule( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_ruleid = lo_result->get_ruleid( ).
  lv_rulearn = lo_result->get_rulearn( ).
  lv_rulename = lo_result->get_rulename( ).
  lv_rulefirewalltype = lo_result->get_firewalltype( ).
  lv_ruletype = lo_result->get_ruletype( ).
  lv_description = lo_result->get_ruledescription( ).
  lo_/aws1/cl_rt_document = lo_result->get_configuration( ).
  IF lo_/aws1/cl_rt_document IS NOT INITIAL.
  ENDIF.
  lv_entitystatus = lo_result->get_status( ).
  lv_entityversion = lo_result->get_version( ).
  lv_updatetoken = lo_result->get_updatetoken( ).
  lv_issnapshot = lo_result->get_issnapshot( ).
  lv_haspublishedversion = lo_result->get_haspublishedversion( ).
  lv_datetimestamp = lo_result->get_updatedat( ).
ENDIF.

Get a rule

Retrieves the current published version of a rule by its base ARN.

DATA(lo_result) = lo_client->getrule( |arn:aws:network-security-manager:us-east-1:123456789012:rule:abc123| ).

Get a specific version of a rule

Retrieves a specific immutable version (snapshot) of a rule using a version-qualified ARN. The response has isSnapshot set to true. Omitting the version qualifier returns the current published rule instead.

DATA(lo_result) = lo_client->getrule( |arn:aws:network-security-manager:us-east-1:123456789012:rule:abc123:3| ).