/AWS1/CL_EMR=>PUTAUTOSCALINGPOLICY()
¶
About PutAutoScalingPolicy¶
Creates or updates an automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in response to the value of a CloudWatch metric.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_clusterid
TYPE /AWS1/EMRCLUSTERID
/AWS1/EMRCLUSTERID
¶
Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.
iv_instancegroupid
TYPE /AWS1/EMRINSTANCEGROUPID
/AWS1/EMRINSTANCEGROUPID
¶
Specifies the ID of the instance group to which the automatic scaling policy is applied.
io_autoscalingpolicy
TYPE REF TO /AWS1/CL_EMRAUTOSCALINGPOLICY
/AWS1/CL_EMRAUTOSCALINGPOLICY
¶
Specifies the definition of the automatic scaling policy.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_emrputautoscplyoutput
/AWS1/CL_EMRPUTAUTOSCPLYOUTPUT
¶
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_emr~putautoscalingpolicy(
io_autoscalingpolicy = new /aws1/cl_emrautoscalingpolicy(
io_constraints = new /aws1/cl_emrscalingconstraints(
iv_maxcapacity = 123
iv_mincapacity = 123
)
it_rules = VALUE /aws1/cl_emrscalingrule=>tt_scalingrulelist(
(
new /aws1/cl_emrscalingrule(
io_action = new /aws1/cl_emrscalingaction(
io_simplescalingpolicyconf = new /aws1/cl_emrsimplescaplyconf(
iv_adjustmenttype = |string|
iv_cooldown = 123
iv_scalingadjustment = 123
)
iv_market = |string|
)
io_trigger = new /aws1/cl_emrscalingtrigger(
io_cloudwatchalarmdefinition = new /aws1/cl_emrcloudwatchalrmdefn(
it_dimensions = VALUE /aws1/cl_emrmetricdimension=>tt_metricdimensionlist(
(
new /aws1/cl_emrmetricdimension(
iv_key = |string|
iv_value = |string|
)
)
)
iv_comparisonoperator = |string|
iv_evaluationperiods = 123
iv_metricname = |string|
iv_namespace = |string|
iv_period = 123
iv_statistic = |string|
iv_threshold = '0.1'
iv_unit = |string|
)
)
iv_description = |string|
iv_name = |string|
)
)
)
)
iv_clusterid = |string|
iv_instancegroupid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_clusterid = lo_result->get_clusterid( ).
lv_instancegroupid = lo_result->get_instancegroupid( ).
lo_autoscalingpolicydescri = lo_result->get_autoscalingpolicy( ).
IF lo_autoscalingpolicydescri IS NOT INITIAL.
lo_autoscalingpolicystatus = lo_autoscalingpolicydescri->get_status( ).
IF lo_autoscalingpolicystatus IS NOT INITIAL.
lv_autoscalingpolicystate = lo_autoscalingpolicystatus->get_state( ).
lo_autoscalingpolicystatec = lo_autoscalingpolicystatus->get_statechangereason( ).
IF lo_autoscalingpolicystatec IS NOT INITIAL.
lv_autoscalingpolicystatec_1 = lo_autoscalingpolicystatec->get_code( ).
lv_string = lo_autoscalingpolicystatec->get_message( ).
ENDIF.
ENDIF.
lo_scalingconstraints = lo_autoscalingpolicydescri->get_constraints( ).
IF lo_scalingconstraints IS NOT INITIAL.
lv_integer = lo_scalingconstraints->get_mincapacity( ).
lv_integer = lo_scalingconstraints->get_maxcapacity( ).
ENDIF.
LOOP AT lo_autoscalingpolicydescri->get_rules( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_name( ).
lv_string = lo_row_1->get_description( ).
lo_scalingaction = lo_row_1->get_action( ).
IF lo_scalingaction IS NOT INITIAL.
lv_markettype = lo_scalingaction->get_market( ).
lo_simplescalingpolicyconf = lo_scalingaction->get_simplescalingpolicyconf( ).
IF lo_simplescalingpolicyconf IS NOT INITIAL.
lv_adjustmenttype = lo_simplescalingpolicyconf->get_adjustmenttype( ).
lv_integer = lo_simplescalingpolicyconf->get_scalingadjustment( ).
lv_integer = lo_simplescalingpolicyconf->get_cooldown( ).
ENDIF.
ENDIF.
lo_scalingtrigger = lo_row_1->get_trigger( ).
IF lo_scalingtrigger IS NOT INITIAL.
lo_cloudwatchalarmdefiniti = lo_scalingtrigger->get_cloudwatchalarmdefn( ).
IF lo_cloudwatchalarmdefiniti IS NOT INITIAL.
lv_comparisonoperator = lo_cloudwatchalarmdefiniti->get_comparisonoperator( ).
lv_integer = lo_cloudwatchalarmdefiniti->get_evaluationperiods( ).
lv_string = lo_cloudwatchalarmdefiniti->get_metricname( ).
lv_string = lo_cloudwatchalarmdefiniti->get_namespace( ).
lv_integer = lo_cloudwatchalarmdefiniti->get_period( ).
lv_statistic = lo_cloudwatchalarmdefiniti->get_statistic( ).
lv_nonnegativedouble = lo_cloudwatchalarmdefiniti->get_threshold( ).
lv_unit = lo_cloudwatchalarmdefiniti->get_unit( ).
LOOP AT lo_cloudwatchalarmdefiniti->get_dimensions( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_key( ).
lv_string = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
lv_arntype = lo_result->get_clusterarn( ).
ENDIF.