Skip to content

/AWS1/CL_IOT=>UPDATESECURITYPROFILE()

About UpdateSecurityProfile

Updates a Device Defender security profile.

Requires permission to access the UpdateSecurityProfile action.

Method Signature

IMPORTING

Required arguments:

iv_securityprofilename TYPE /AWS1/IOTSECURITYPROFILENAME /AWS1/IOTSECURITYPROFILENAME

The name of the security profile you want to update.

Optional arguments:

iv_securityprofiledesc TYPE /AWS1/IOTSECURITYPROFILEDESC /AWS1/IOTSECURITYPROFILEDESC

A description of the security profile.

it_behaviors TYPE /AWS1/CL_IOTBEHAVIOR=>TT_BEHAVIORS TT_BEHAVIORS

Specifies the behaviors that, when violated by a device (thing), cause an alert.

it_alerttargets TYPE /AWS1/CL_IOTALERTTARGET=>TT_ALERTTARGETS TT_ALERTTARGETS

Where the alerts are sent. (Alerts are always sent to the console.)

it_additionalmetricstoretain TYPE /AWS1/CL_IOTADDLMETTORTNLIST_W=>TT_ADDLMETRICSTORETAINLIST TT_ADDLMETRICSTORETAINLIST

Please use UpdateSecurityProfileRequest$additionalMetricsToRetainV2 instead.

A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the profile's behaviors, but it is also retained for any metric specified here. Can be used with custom metrics; cannot be used with dimensions.

it_addlmetricstoretainv2 TYPE /AWS1/CL_IOTMETRICTORETAIN=>TT_ADDLMETRICSTORETAINV2LIST TT_ADDLMETRICSTORETAINV2LIST

A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the profile's behaviors, but it is also retained for any metric specified here. Can be used with custom metrics; cannot be used with dimensions.

iv_deletebehaviors TYPE /AWS1/IOTDELETEBEHAVIORS /AWS1/IOTDELETEBEHAVIORS

If true, delete all behaviors defined for this security profile. If any behaviors are defined in the current invocation, an exception occurs.

iv_deletealerttargets TYPE /AWS1/IOTDELETEALERTTARGETS /AWS1/IOTDELETEALERTTARGETS

If true, delete all alertTargets defined for this security profile. If any alertTargets are defined in the current invocation, an exception occurs.

iv_deleteaddlmetricstoretain TYPE /AWS1/IOTDELETEADDLMETTORETAIN /AWS1/IOTDELETEADDLMETTORETAIN

If true, delete all additionalMetricsToRetain defined for this security profile. If any additionalMetricsToRetain are defined in the current invocation, an exception occurs.

iv_expectedversion TYPE /AWS1/IOTOPTIONALVERSION /AWS1/IOTOPTIONALVERSION

The expected version of the security profile. A new version is generated whenever the security profile is updated. If you specify a value that is different from the actual version, a VersionConflictException is thrown.

io_metricsexportconfig TYPE REF TO /AWS1/CL_IOTMETEXPORTCONFIG /AWS1/CL_IOTMETEXPORTCONFIG

Specifies the MQTT topic and role ARN required for metric export.

iv_deletemetricsexportconfig TYPE /AWS1/IOTDELETEMETEXPORTCONFIG /AWS1/IOTDELETEMETEXPORTCONFIG

Set the value as true to delete metrics export related configurations.

RETURNING

oo_output TYPE REF TO /aws1/cl_iotupdatesecpflrsp /AWS1/CL_IOTUPDATESECPFLRSP

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->/aws1/if_iot~updatesecurityprofile(
  io_metricsexportconfig = new /aws1/cl_iotmetexportconfig(
    iv_mqtttopic = |string|
    iv_rolearn = |string|
  )
  it_additionalmetricstoretain = VALUE /aws1/cl_iotaddlmettortnlist_w=>tt_addlmetricstoretainlist(
    ( new /aws1/cl_iotaddlmettortnlist_w( |string| ) )
  )
  it_addlmetricstoretainv2 = VALUE /aws1/cl_iotmetrictoretain=>tt_addlmetricstoretainv2list(
    (
      new /aws1/cl_iotmetrictoretain(
        io_metricdimension = new /aws1/cl_iotmetricdimension(
          iv_dimensionname = |string|
          iv_operator = |string|
        )
        iv_exportmetric = ABAP_TRUE
        iv_metric = |string|
      )
    )
  )
  it_alerttargets = VALUE /aws1/cl_iotalerttarget=>tt_alerttargets(
    (
      VALUE /aws1/cl_iotalerttarget=>ts_alerttargets_maprow(
        value = new /aws1/cl_iotalerttarget(
          iv_alerttargetarn = |string|
          iv_rolearn = |string|
        )
        key = |string|
      )
    )
  )
  it_behaviors = VALUE /aws1/cl_iotbehavior=>tt_behaviors(
    (
      new /aws1/cl_iotbehavior(
        io_criteria = new /aws1/cl_iotbehaviorcriteria(
          io_mldetectionconfig = new /aws1/cl_iotmldetectionconfig( |string| )
          io_statisticalthreshold = new /aws1/cl_iotstatlthreshold( |string| )
          io_value = new /aws1/cl_iotmetricvalue(
            it_cidrs = VALUE /aws1/cl_iotcidrs_w=>tt_cidrs(
              ( new /aws1/cl_iotcidrs_w( |string| ) )
            )
            it_numbers = VALUE /aws1/cl_iotnumberlist_w=>tt_numberlist(
              ( new /aws1/cl_iotnumberlist_w( |0.1| ) )
            )
            it_ports = VALUE /aws1/cl_iotports_w=>tt_ports(
              ( new /aws1/cl_iotports_w( 123 ) )
            )
            it_strings = VALUE /aws1/cl_iotstringlist_w=>tt_stringlist(
              ( new /aws1/cl_iotstringlist_w( |string| ) )
            )
            iv_count = 123
            iv_number = '0.1'
          )
          iv_comparisonoperator = |string|
          iv_conseqdatapointstoalarm = 123
          iv_conseqdatapointstoclear = 123
          iv_durationseconds = 123
        )
        io_metricdimension = new /aws1/cl_iotmetricdimension(
          iv_dimensionname = |string|
          iv_operator = |string|
        )
        iv_exportmetric = ABAP_TRUE
        iv_metric = |string|
        iv_name = |string|
        iv_suppressalerts = ABAP_TRUE
      )
    )
  )
  iv_deleteaddlmetricstoretain = ABAP_TRUE
  iv_deletealerttargets = ABAP_TRUE
  iv_deletebehaviors = ABAP_TRUE
  iv_deletemetricsexportconfig = ABAP_TRUE
  iv_expectedversion = 123
  iv_securityprofiledesc = |string|
  iv_securityprofilename = |string|
).

This is an example of reading all possible response values

lv_securityprofilename = lo_result->get_securityprofilename( ).
lv_securityprofilearn = lo_result->get_securityprofilearn( ).
lv_securityprofiledescript = lo_result->get_securityprofiledesc( ).
LOOP AT lo_result->get_behaviors( ) into lo_row.
  lv_behaviorname = lo_row_1->get_name( ).
  lv_behaviormetric = lo_row_1->get_metric( ).
  lv_dimensionname = lo_metricdimension->get_dimensionname( ).
  lv_dimensionvalueoperator = lo_metricdimension->get_operator( ).
  lv_comparisonoperator = lo_behaviorcriteria->get_comparisonoperator( ).
  lv_unsignedlong = lo_metricvalue->get_count( ).
  LOOP AT lo_metricvalue->get_cidrs( ) into lo_row_2.
    lv_cidr = lo_row_3->get_value( ).
  ENDLOOP.
  LOOP AT lo_metricvalue->get_ports( ) into lo_row_4.
    lv_port = lo_row_5->get_value( ).
  ENDLOOP.
  lv_number = lo_metricvalue->get_number( ).
  LOOP AT lo_metricvalue->get_numbers( ) into lo_row_6.
    lv_number = lo_row_7->get_value( ).
  ENDLOOP.
  LOOP AT lo_metricvalue->get_strings( ) into lo_row_8.
    lv_stringvalue = lo_row_9->get_value( ).
  ENDLOOP.
  lv_durationseconds = lo_behaviorcriteria->get_durationseconds( ).
  lv_consecutivedatapointsto = lo_behaviorcriteria->get_conseqdatapointstoalarm( ).
  lv_consecutivedatapointsto_1 = lo_behaviorcriteria->get_conseqdatapointstoclear( ).
  lv_evaluationstatistic = lo_statisticalthreshold->get_statistic( ).
  lv_confidencelevel = lo_machinelearningdetectio->get_confidencelevel( ).
  lv_suppressalerts = lo_row_1->get_suppressalerts( ).
  lv_exportmetric = lo_row_1->get_exportmetric( ).
ENDLOOP.
LOOP AT lo_result->get_alerttargets( ) into ls_row_10.
  lv_key = ls_row_10-key.
  lv_alerttargetarn = lo_value->get_alerttargetarn( ).
  lv_rolearn = lo_value->get_rolearn( ).
ENDLOOP.
LOOP AT lo_result->get_addlmetricstoretain( ) into lo_row_11.
  lv_behaviormetric = lo_row_12->get_value( ).
ENDLOOP.
LOOP AT lo_result->get_addlmetricstoretainv2( ) into lo_row_13.
  lv_behaviormetric = lo_row_14->get_metric( ).
  lv_dimensionname = lo_metricdimension->get_dimensionname( ).
  lv_dimensionvalueoperator = lo_metricdimension->get_operator( ).
  lv_exportmetric = lo_row_14->get_exportmetric( ).
ENDLOOP.
lv_version = lo_result->get_version( ).
lv_timestamp = lo_result->get_creationdate( ).
lv_timestamp = lo_result->get_lastmodifieddate( ).
lv_mqtttopic = lo_metricsexportconfig->get_mqtttopic( ).
lv_rolearn = lo_metricsexportconfig->get_rolearn( ).