Skip to content

/AWS1/IF_EC2=>ENBINSTSQLHASTANDBYDETECTS()

About EnableInstanceSqlHaStandbyDetections

Enable Amazon EC2 instances running in an SQL Server High Availability cluster for SQL Server High Availability instance standby detection monitoring. Once enabled, Amazon Web Services monitors the metadata for the instances to determine whether they are active or standby nodes in the SQL Server High Availability cluster. If the instances are determined to be standby failover nodes, Amazon Web Services automatically applies SQL Server licensing fee waiver for those instances.

To register an instance, it must be running a Windows SQL Server license-included AMI and have the Amazon Web Services Systems Manager agent installed and running. Only Windows Server 2019 and later and SQL Server (Standard and Enterprise editions) 2017 and later are supported. For more information, see Prerequisites for using SQL Server High Availability instance standby detection.

Method Signature

METHODS /AWS1/IF_EC2~ENBINSTSQLHASTANDBYDETECTS
  IMPORTING
    !IT_INSTANCEIDS TYPE /AWS1/CL_EC2INSTIDUPDSTRLIST_W=>TT_INSTANCEIDUPDATESTRINGLIST OPTIONAL
    !IV_SQLSERVERCREDENTIALS TYPE /AWS1/EC2SECRETARN OPTIONAL
    !IV_DRYRUN TYPE /AWS1/EC2BOOLEAN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ec2enbinsqlhastandb01
  RAISING
    /AWS1/CX_EC2CLIENTEXC
    /AWS1/CX_EC2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

it_instanceids TYPE /AWS1/CL_EC2INSTIDUPDSTRLIST_W=>TT_INSTANCEIDUPDATESTRINGLIST TT_INSTANCEIDUPDATESTRINGLIST

The IDs of the instances to enable for SQL Server High Availability standby detection monitoring.

Optional arguments:

iv_sqlservercredentials TYPE /AWS1/EC2SECRETARN /AWS1/EC2SECRETARN

The ARN of the Secrets Manager secret containing the SQL Server access credentials. The specified secret must contain valid SQL Server credentials for the specified instances. If not specified, deafult local user credentials will be used by the Amazon Web Services Systems Manager agent. To enable instances with different credentials, you must make separate requests.

iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2enbinsqlhastandb01 /AWS1/CL_EC2ENBINSQLHASTANDB01

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->enbinstsqlhastandbydetects(
  it_instanceids = VALUE /aws1/cl_ec2instidupdstrlist_w=>tt_instanceidupdatestringlist(
    ( new /aws1/cl_ec2instidupdstrlist_w( |string| ) )
  )
  iv_dryrun = ABAP_TRUE
  iv_sqlservercredentials = |string|
).

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_instances( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_instanceid = lo_row_1->get_instanceid( ).
      lv_sqlserverlicenseusage = lo_row_1->get_sqlserverlicenseusage( ).
      lv_hastatus = lo_row_1->get_hastatus( ).
      lv_string = lo_row_1->get_processingstatus( ).
      lv_milliseconddatetime = lo_row_1->get_lastupdatedtime( ).
      lv_string = lo_row_1->get_sqlservercredentials( ).
      LOOP AT lo_row_1->get_tags( ) 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.
  ENDLOOP.
ENDIF.