/AWS1/IF_EC2=>ASSOCIATEAPPSTATUSCHECK()¶
About AssociateApplicationStatusCheck¶
Associates an application status check with instances or tags. Once you create an association, health monitoring automatically begins for the specified instances or for instances that match the specified tags. The following rules apply:
-
You must specify either
TargetTagAssociationsorInstanceIds, but not both. Specifying both results in anInvalidParameterCombinationerror. -
The application status check must already exist and belong to your account.
-
Tag keys must not be blank.
-
Maximum 50 tag associations per application status check.
-
Use
DisassociateApplicationStatusCheckto remove associations. -
When you associate tags, the application status check automatically monitors all current and future instances that have the specified tags.
Method Signature¶
METHODS /AWS1/IF_EC2~ASSOCIATEAPPSTATUSCHECK
IMPORTING
!IV_APPLICATIONSTATUSCHECKID TYPE /AWS1/EC2APPSTATUSCHECKID OPTIONAL
!IT_TARGETTAGASSOCIATIONS TYPE /AWS1/CL_EC2CUSTTAGKYVALREQPAR=>TT_CUSTOMKEYVALUEPAIRREQSET OPTIONAL
!IT_INSTANCEIDS TYPE /AWS1/CL_EC2INSTANCEIDLIST_W=>TT_INSTANCEIDLIST OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/EC2STRING OPTIONAL
!IV_DRYRUN TYPE /AWS1/EC2BOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ec2asscapptatuschkrs
RAISING
/AWS1/CX_EC2CLIENTEXC
/AWS1/CX_EC2SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_applicationstatuscheckid TYPE /AWS1/EC2APPSTATUSCHECKID /AWS1/EC2APPSTATUSCHECKID¶
The ID of the application status check to associate.
Optional arguments:¶
it_targettagassociations TYPE /AWS1/CL_EC2CUSTTAGKYVALREQPAR=>TT_CUSTOMKEYVALUEPAIRREQSET TT_CUSTOMKEYVALUEPAIRREQSET¶
The tags to associate the application status check with. Each tag is a key-value pair. When you associate tags, the application status check automatically monitors all instances that have the specified tags.
it_instanceids TYPE /AWS1/CL_EC2INSTANCEIDLIST_W=>TT_INSTANCEIDLIST TT_INSTANCEIDLIST¶
The IDs of the instances to associate with the application status check.
iv_clienttoken TYPE /AWS1/EC2STRING /AWS1/EC2STRING¶
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN¶
Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ec2asscapptatuschkrs /AWS1/CL_EC2ASSCAPPTATUSCHKRS¶
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->associateappstatuscheck(
it_instanceids = VALUE /aws1/cl_ec2instanceidlist_w=>tt_instanceidlist(
( new /aws1/cl_ec2instanceidlist_w( |string| ) )
)
it_targettagassociations = VALUE /aws1/cl_ec2custtagkyvalreqpar=>tt_customkeyvaluepairreqset(
(
new /aws1/cl_ec2custtagkyvalreqpar(
iv_key = |string|
iv_value = |string|
)
)
)
iv_applicationstatuscheckid = |string|
iv_clienttoken = |string|
iv_dryrun = ABAP_TRUE
).
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_successfulresults( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_applicationstatuschecki = lo_row_1->get_applicationstatuscheckid( ).
lv_string = lo_row_1->get_associationtype( ).
lv_string = lo_row_1->get_associationvalue( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_unsuccessfulresults( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_applicationstatuschecki = lo_row_3->get_applicationstatuscheckid( ).
lv_string = lo_row_3->get_associationtype( ).
lv_string = lo_row_3->get_associationvalue( ).
lv_string = lo_row_3->get_reason( ).
ENDIF.
ENDLOOP.
ENDIF.
To associate an application status check with tags¶
This example associates an application status check with instances matching the specified tag.
DATA(lo_result) = lo_client->associateappstatuscheck(
it_targettagassociations = VALUE /aws1/cl_ec2custtagkyvalreqpar=>tt_customkeyvaluepairreqset(
(
new /aws1/cl_ec2custtagkyvalreqpar(
iv_key = |env|
iv_value = |prod|
)
)
)
iv_applicationstatuscheckid = |asc-0123456789abcdef0|
).