/AWS1/IF_IOT=>UPDATESECURITYPROFILE()¶
About UpdateSecurityProfile¶
Updates a Device Defender security profile.
Requires permission to access the UpdateSecurityProfile action.
Method Signature¶
METHODS /AWS1/IF_IOT~UPDATESECURITYPROFILE
IMPORTING
!IV_SECURITYPROFILENAME TYPE /AWS1/IOTSECURITYPROFILENAME OPTIONAL
!IV_SECURITYPROFILEDESC TYPE /AWS1/IOTSECURITYPROFILEDESC OPTIONAL
!IT_BEHAVIORS TYPE /AWS1/CL_IOTBEHAVIOR=>TT_BEHAVIORS OPTIONAL
!IT_ALERTTARGETS TYPE /AWS1/CL_IOTALERTTARGET=>TT_ALERTTARGETS OPTIONAL
!IT_ADDITIONALMETRICSTORETAIN TYPE /AWS1/CL_IOTADDLMETTORTNLIST_W=>TT_ADDLMETRICSTORETAINLIST OPTIONAL
!IT_ADDLMETRICSTORETAINV2 TYPE /AWS1/CL_IOTMETRICTORETAIN=>TT_ADDLMETRICSTORETAINV2LIST OPTIONAL
!IV_DELETEBEHAVIORS TYPE /AWS1/IOTDELETEBEHAVIORS OPTIONAL
!IV_DELETEALERTTARGETS TYPE /AWS1/IOTDELETEALERTTARGETS OPTIONAL
!IV_DELETEADDLMETRICSTORETAIN TYPE /AWS1/IOTDELETEADDLMETTORETAIN OPTIONAL
!IV_EXPECTEDVERSION TYPE /AWS1/IOTOPTIONALVERSION OPTIONAL
!IO_METRICSEXPORTCONFIG TYPE REF TO /AWS1/CL_IOTMETEXPORTCONFIG OPTIONAL
!IV_DELETEMETRICSEXPORTCONFIG TYPE /AWS1/IOTDELETEMETEXPORTCONFIG OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iotupdatesecpflrsp
RAISING
/AWS1/CX_IOTINTERNALFAILUREEX
/AWS1/CX_IOTINVALIDREQUESTEX
/AWS1/CX_IOTRESOURCENOTFOUNDEX
/AWS1/CX_IOTTHROTTLINGEX
/AWS1/CX_IOTVERSIONCONFLICTEX
/AWS1/CX_IOTCLIENTEXC
/AWS1/CX_IOTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
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
behaviorsdefined for this security profile. If anybehaviorsare defined in the current invocation, an exception occurs.
iv_deletealerttargets TYPE /AWS1/IOTDELETEALERTTARGETS /AWS1/IOTDELETEALERTTARGETS¶
If true, delete all
alertTargetsdefined for this security profile. If anyalertTargetsare defined in the current invocation, an exception occurs.
iv_deleteaddlmetricstoretain TYPE /AWS1/IOTDELETEADDLMETTORETAIN /AWS1/IOTDELETEADDLMETTORETAIN¶
If true, delete all
additionalMetricsToRetaindefined for this security profile. If anyadditionalMetricsToRetainare 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
VersionConflictExceptionis 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->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
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
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.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_behaviorname = lo_row_1->get_name( ).
lv_behaviormetric = lo_row_1->get_metric( ).
lo_metricdimension = lo_row_1->get_metricdimension( ).
IF lo_metricdimension IS NOT INITIAL.
lv_dimensionname = lo_metricdimension->get_dimensionname( ).
lv_dimensionvalueoperator = lo_metricdimension->get_operator( ).
ENDIF.
lo_behaviorcriteria = lo_row_1->get_criteria( ).
IF lo_behaviorcriteria IS NOT INITIAL.
lv_comparisonoperator = lo_behaviorcriteria->get_comparisonoperator( ).
lo_metricvalue = lo_behaviorcriteria->get_value( ).
IF lo_metricvalue IS NOT INITIAL.
lv_unsignedlong = lo_metricvalue->get_count( ).
LOOP AT lo_metricvalue->get_cidrs( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_cidr = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_metricvalue->get_ports( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_port = lo_row_5->get_value( ).
ENDIF.
ENDLOOP.
lv_number = lo_metricvalue->get_number( ).
LOOP AT lo_metricvalue->get_numbers( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_number = lo_row_7->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_metricvalue->get_strings( ) into lo_row_8.
lo_row_9 = lo_row_8.
IF lo_row_9 IS NOT INITIAL.
lv_stringvalue = lo_row_9->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
lv_durationseconds = lo_behaviorcriteria->get_durationseconds( ).
lv_consecutivedatapointsto = lo_behaviorcriteria->get_conseqdatapointstoalarm( ).
lv_consecutivedatapointsto_1 = lo_behaviorcriteria->get_conseqdatapointstoclear( ).
lo_statisticalthreshold = lo_behaviorcriteria->get_statisticalthreshold( ).
IF lo_statisticalthreshold IS NOT INITIAL.
lv_evaluationstatistic = lo_statisticalthreshold->get_statistic( ).
ENDIF.
lo_machinelearningdetectio = lo_behaviorcriteria->get_mldetectionconfig( ).
IF lo_machinelearningdetectio IS NOT INITIAL.
lv_confidencelevel = lo_machinelearningdetectio->get_confidencelevel( ).
ENDIF.
ENDIF.
lv_suppressalerts = lo_row_1->get_suppressalerts( ).
lv_exportmetric = lo_row_1->get_exportmetric( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_alerttargets( ) into ls_row_10.
lv_key = ls_row_10-key.
lo_value = ls_row_10-value.
IF lo_value IS NOT INITIAL.
lv_alerttargetarn = lo_value->get_alerttargetarn( ).
lv_rolearn = lo_value->get_rolearn( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_addlmetricstoretain( ) into lo_row_11.
lo_row_12 = lo_row_11.
IF lo_row_12 IS NOT INITIAL.
lv_behaviormetric = lo_row_12->get_value( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_addlmetricstoretainv2( ) into lo_row_13.
lo_row_14 = lo_row_13.
IF lo_row_14 IS NOT INITIAL.
lv_behaviormetric = lo_row_14->get_metric( ).
lo_metricdimension = lo_row_14->get_metricdimension( ).
IF lo_metricdimension IS NOT INITIAL.
lv_dimensionname = lo_metricdimension->get_dimensionname( ).
lv_dimensionvalueoperator = lo_metricdimension->get_operator( ).
ENDIF.
lv_exportmetric = lo_row_14->get_exportmetric( ).
ENDIF.
ENDLOOP.
lv_version = lo_result->get_version( ).
lv_timestamp = lo_result->get_creationdate( ).
lv_timestamp = lo_result->get_lastmodifieddate( ).
lo_metricsexportconfig = lo_result->get_metricsexportconfig( ).
IF lo_metricsexportconfig IS NOT INITIAL.
lv_mqtttopic = lo_metricsexportconfig->get_mqtttopic( ).
lv_rolearn = lo_metricsexportconfig->get_rolearn( ).
ENDIF.
ENDIF.